<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
    template="template/test-materials.xhtml"> 
      <h:outputStylesheet>
      .error{
      	color:red;
      }
    </h:outputStylesheet>
<ui:define name="title">Administration | Create Test</ui:define>
<ui:define name="body">
<div id="test">
<h1>Създаване на тест</h1>
<p>Обузначените със <span style="color:red;">*</span> полета са задължителни !</p>
<h:form id="dgp" >
	<rich:panel style="height: 500px; width:100%;">
    	<div id="formTest">
    	<h1>Настройки</h1>
    	<table>
    		<tr><td class="t"><span style="color:red;">* </span>Заглавие на теста</td><td><h:inputText id="title" requiredMessage=" празно поле" label="title" required="true" value="#{t.test.testName}">
    		
    		</h:inputText> <h:message style="color:red;"  for="title"> </h:message></td></tr>
    		
    		<tr><td class="t"><span style="color:red;">* </span>Описание на теста</td><td><h:inputTextarea id="description" value="#{t.test.description}" requiredMessage=" празно поле" label="description" required="true" rows="5" cols="40" /> <h:message style="color:red;" for="description"> </h:message></td></tr>
    		
    		<tr><td class="t"><span style="color:red;">* </span>Брой въпроси</td><td><h:inputText validatorMessage=" изберете в границата [2-100]" id="questions" style="width:25px;" value="#{t.test.numQuestions}"><f:validateLongRange minimum="2" maximum="100" /></h:inputText> <h:message style="color:red;"  for="questions"></h:message></td></tr>
    		
    		<tr><td class="t"><span style="color:red;">* </span>Брой отговори за въпрос</td><td><h:inputText validatorMessage=" изберете в границата [2-11]" id="answers" style="width:25px;" value="#{t.test.numAnswPerQuestion}"><f:validateLongRange minimum="2" maximum="11" /></h:inputText> <h:message style="color:red;"  for="answers"></h:message></td></tr>
    		
			<tr><td class="t">Точкова система</td><td>
			<h:selectOneMenu  value="#{t.test.pointSystem}" >
				<f:selectItem itemLabel="ДА" itemValue="0" />
				<f:selectItem itemLabel="НЕ" itemValue="1" />
			</h:selectOneMenu>
			</td></tr>
    		
    		<tr><td class="t">Показване на резултат</td><td>
    		
    		<h:selectOneMenu value="#{t.test.showResult}" >
				<f:selectItem itemLabel="ДА" itemValue="0" />
				<f:selectItem itemLabel="НЕ" itemValue="1" />
			</h:selectOneMenu>
    		
    		</td></tr>
    		
    		<tr><td class="t">Нива на трудност</td><td>
    		
    		<h:selectOneMenu value="#{t.test.level}" >
				<f:selectItem itemLabel="Ниво 1" itemValue="1" />
				<f:selectItem itemLabel="Ниво 2" itemValue="2" />
				<f:selectItem itemLabel="Ниво 3" itemValue="3" />
				<f:selectItem itemLabel="Ниво 4" itemValue="4" />
			</h:selectOneMenu>
    		
    		</td></tr>
    		
    		<tr><td class="t"></td><td></td></tr>
    		
    		<tr><td class="t">Съобщение след решен тест</td><td><h:inputText value="#{t.test.msg}" /></td></tr>
    		
    		<tr><td class="t"></td><td></td></tr>
    		<tr><td class="t">
    			<h:commandButton styleClass="btnGenerateTest" action="#{t.save(t.test)}" value="Генерирай тест">
    			</h:commandButton>
    		</td><td></td></tr>
    	
    	</table> 
    	
    	</div>
    </rich:panel>
    </h:form>
    <br />
 </div>
 
</ui:define>
</ui:composition>